<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<TITLE>
ImageMetadataReader (metadata-extractor - Javadoc - Extracts Exif, IPTC, XMP, ICC and other metadata from image files)
</TITLE>

<META NAME="keywords" CONTENT="com.drew.imaging.ImageMetadataReader class">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    parent.document.title="ImageMetadataReader (metadata-extractor - Javadoc - Extracts Exif, IPTC, XMP, ICC and other metadata from image files)";
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>

</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">


<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/ImageMetadataReader.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<a href='http://www.drewnoakes.com/code/exif/' title='Go to the project home page.'><img src='http://metadata-extractor.googlecode.com/git/Resources/metadata-extractor-logo-131x30.png' border=0 alt='Metadata Extractor Logo'></a></EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;PREV CLASS&nbsp;
&nbsp;<A HREF="../../../com/drew/imaging/ImageProcessingException.html" title="class in com.drew.imaging"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../index.html?com/drew/imaging/ImageMetadataReader.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="ImageMetadataReader.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
com.drew.imaging</FONT>
<BR>
Class ImageMetadataReader</H2>
<PRE>
java.lang.Object
  <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>com.drew.imaging.ImageMetadataReader</B>
</PRE>
<HR>
<DL>
<DT><PRE>public class <B>ImageMetadataReader</B><DT>extends java.lang.Object</DL>
</PRE>

<P>
Obtains <A HREF="../../../com/drew/metadata/Metadata.html" title="class in com.drew.metadata"><CODE>Metadata</CODE></A> from all supported file formats.
 <p/>
 This class a lightweight wrapper around specific file type processors:
 <ul>
     <li><A HREF="../../../com/drew/imaging/jpeg/JpegMetadataReader.html" title="class in com.drew.imaging.jpeg"><CODE>JpegMetadataReader</CODE></A> for JPEG files</li>
     <li><A HREF="../../../com/drew/imaging/tiff/TiffMetadataReader.html" title="class in com.drew.imaging.tiff"><CODE>TiffMetadataReader</CODE></A> for TIFF and (most) RAW files</li>
     <li><A HREF="../../../com/drew/imaging/psd/PsdMetadataReader.html" title="class in com.drew.imaging.psd"><CODE>PsdMetadataReader</CODE></A> for Photoshop files</li>
     <li><A HREF="../../../com/drew/imaging/png/PngMetadataReader.html" title="class in com.drew.imaging.png"><CODE>PngMetadataReader</CODE></A> for BMP files</li>
     <li><A HREF="../../../com/drew/imaging/bmp/BmpMetadataReader.html" title="class in com.drew.imaging.bmp"><CODE>BmpMetadataReader</CODE></A> for BMP files</li>
     <li><A HREF="../../../com/drew/imaging/gif/GifMetadataReader.html" title="class in com.drew.imaging.gif"><CODE>GifMetadataReader</CODE></A> for GIF files</li>
 </ul>
 If you know the file type you're working with, you may use one of the above processors directly.
 For most scenarios it is simpler, more convenient and more robust to use this class.
<P>

<P>
<DL>
<DT><B>Author:</B></DT>
  <DD>Drew Noakes http://drewnoakes.com</DD>
</DL>
<HR>

<P>

<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/drew/imaging/ImageMetadataReader.html#main(java.lang.String[])">main</A></B>(java.lang.String[]&nbsp;args)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;An application entry point.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;<A HREF="../../../com/drew/metadata/Metadata.html" title="class in com.drew.metadata">Metadata</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/drew/imaging/ImageMetadataReader.html#readMetadata(java.io.File)">readMetadata</A></B>(java.io.File&nbsp;file)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Reads <A HREF="../../../com/drew/metadata/Metadata.html" title="class in com.drew.metadata"><CODE>Metadata</CODE></A> from a <CODE>File</CODE> object.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;<A HREF="../../../com/drew/metadata/Metadata.html" title="class in com.drew.metadata">Metadata</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../com/drew/imaging/ImageMetadataReader.html#readMetadata(java.io.InputStream)">readMetadata</A></B>(java.io.InputStream&nbsp;inputStream)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Reads metadata from an <CODE>InputStream</CODE>.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="readMetadata(java.io.InputStream)"><!-- --></A><H3>
readMetadata</H3>
<PRE>
public static <A HREF="../../../com/drew/metadata/Metadata.html" title="class in com.drew.metadata">Metadata</A> <B>readMetadata</B>(java.io.InputStream&nbsp;inputStream)
                             throws <A HREF="../../../com/drew/imaging/ImageProcessingException.html" title="class in com.drew.imaging">ImageProcessingException</A>,
                                    java.io.IOException</PRE>
<DL>
<DD>Reads metadata from an <CODE>InputStream</CODE>.
 <p/>
 The file type is determined by inspecting the leading bytes of the stream, and parsing of the file
 is delegated to one of:
 <ul>
     <li><A HREF="../../../com/drew/imaging/jpeg/JpegMetadataReader.html" title="class in com.drew.imaging.jpeg"><CODE>JpegMetadataReader</CODE></A> for JPEG files</li>
     <li><A HREF="../../../com/drew/imaging/tiff/TiffMetadataReader.html" title="class in com.drew.imaging.tiff"><CODE>TiffMetadataReader</CODE></A> for TIFF and (most) RAW files</li>
     <li><A HREF="../../../com/drew/imaging/psd/PsdMetadataReader.html" title="class in com.drew.imaging.psd"><CODE>PsdMetadataReader</CODE></A> for Photoshop files</li>
     <li><A HREF="../../../com/drew/imaging/png/PngMetadataReader.html" title="class in com.drew.imaging.png"><CODE>PngMetadataReader</CODE></A> for PNG files</li>
     <li><A HREF="../../../com/drew/imaging/bmp/BmpMetadataReader.html" title="class in com.drew.imaging.bmp"><CODE>BmpMetadataReader</CODE></A> for BMP files</li>
     <li><A HREF="../../../com/drew/imaging/gif/GifMetadataReader.html" title="class in com.drew.imaging.gif"><CODE>GifMetadataReader</CODE></A> for GIF files</li>
 </ul>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>inputStream</CODE> - a stream from which the file data may be read.  The stream must be positioned at the
                    beginning of the file's data.
<DT><B>Returns:</B><DD>a populated <A HREF="../../../com/drew/metadata/Metadata.html" title="class in com.drew.metadata"><CODE>Metadata</CODE></A> object containing directories of tags with values and any processing errors.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../com/drew/imaging/ImageProcessingException.html" title="class in com.drew.imaging">ImageProcessingException</A></CODE> - if the file type is unknown, or for general processing errors.
<DD><CODE>java.io.IOException</CODE></DL>
</DD>
</DL>
<HR>

<A NAME="readMetadata(java.io.File)"><!-- --></A><H3>
readMetadata</H3>
<PRE>
public static <A HREF="../../../com/drew/metadata/Metadata.html" title="class in com.drew.metadata">Metadata</A> <B>readMetadata</B>(java.io.File&nbsp;file)
                             throws <A HREF="../../../com/drew/imaging/ImageProcessingException.html" title="class in com.drew.imaging">ImageProcessingException</A>,
                                    java.io.IOException</PRE>
<DL>
<DD>Reads <A HREF="../../../com/drew/metadata/Metadata.html" title="class in com.drew.metadata"><CODE>Metadata</CODE></A> from a <CODE>File</CODE> object.
 <p/>
 The file type is determined by inspecting the leading bytes of the stream, and parsing of the file
 is delegated to one of:
 <ul>
     <li><A HREF="../../../com/drew/imaging/jpeg/JpegMetadataReader.html" title="class in com.drew.imaging.jpeg"><CODE>JpegMetadataReader</CODE></A> for JPEG files</li>
     <li><A HREF="../../../com/drew/imaging/tiff/TiffMetadataReader.html" title="class in com.drew.imaging.tiff"><CODE>TiffMetadataReader</CODE></A> for TIFF and (most) RAW files</li>
     <li><A HREF="../../../com/drew/imaging/psd/PsdMetadataReader.html" title="class in com.drew.imaging.psd"><CODE>PsdMetadataReader</CODE></A> for Photoshop files</li>
     <li><A HREF="../../../com/drew/imaging/png/PngMetadataReader.html" title="class in com.drew.imaging.png"><CODE>PngMetadataReader</CODE></A> for PNG files</li>
     <li><A HREF="../../../com/drew/imaging/bmp/BmpMetadataReader.html" title="class in com.drew.imaging.bmp"><CODE>BmpMetadataReader</CODE></A> for BMP files</li>
     <li><A HREF="../../../com/drew/imaging/gif/GifMetadataReader.html" title="class in com.drew.imaging.gif"><CODE>GifMetadataReader</CODE></A> for GIF files</li>
 </ul>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>file</CODE> - a file from which the image data may be read.
<DT><B>Returns:</B><DD>a populated <A HREF="../../../com/drew/metadata/Metadata.html" title="class in com.drew.metadata"><CODE>Metadata</CODE></A> object containing directories of tags with values and any processing errors.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../com/drew/imaging/ImageProcessingException.html" title="class in com.drew.imaging">ImageProcessingException</A></CODE> - for general processing errors.
<DD><CODE>java.io.IOException</CODE></DL>
</DD>
</DL>
<HR>

<A NAME="main(java.lang.String[])"><!-- --></A><H3>
main</H3>
<PRE>
public static void <B>main</B>(java.lang.String[]&nbsp;args)
                 throws <A HREF="../../../com/drew/metadata/MetadataException.html" title="class in com.drew.metadata">MetadataException</A>,
                        java.io.IOException</PRE>
<DL>
<DD>An application entry point.  Takes the name of one or more files as arguments and prints the contents of all
 metadata directories to <code>System.out</code>.
 <p/>
 If <code>-thumb</code> is passed, then any thumbnail data will be written to a file with name of the
 input file having <code>.thumb.jpg</code> appended.
 <p/>
 If <code>-wiki</code> is passed, then output will be in a format suitable for Google Code's wiki.
 <p/>
 If <code>-hex</code> is passed, then the ID of each tag will be displayed in hexadecimal.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>args</CODE> - the command line arguments
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../com/drew/metadata/MetadataException.html" title="class in com.drew.metadata">MetadataException</A></CODE>
<DD><CODE>java.io.IOException</CODE></DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>


<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/ImageMetadataReader.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
<a href='http://www.drewnoakes.com/code/exif/' title='Go to the project home page.'><img src='http://metadata-extractor.googlecode.com/git/Resources/metadata-extractor-logo-131x30.png' border=0 alt='Metadata Extractor Logo'></a></EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;PREV CLASS&nbsp;
&nbsp;<A HREF="../../../com/drew/imaging/ImageProcessingException.html" title="class in com.drew.imaging"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../index.html?com/drew/imaging/ImageMetadataReader.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="ImageMetadataReader.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>
<i>Copyright &#169; 2002-2013 Drew Noakes. All Rights Reserved.</i>
<script src='http://www.google-analytics.com/urchin.js' type='text/javascript'></script>
<script type='text/javascript'>
_uacct = 'UA-936661-1';
urchinTracker();
</script>
</BODY>
</HTML>
